package com.sl.au;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;

import com.sl.au.entity.StorageProperties;
import com.sl.au.interceptor.ActivitiTaskListener;
import com.sl.au.service.ActivitiService;
import com.sl.au.service.AttachmentService;

@SpringBootApplication
@EnableConfigurationProperties(StorageProperties.class)
@EnableScheduling
	public class CRMApplication{

	private static Logger logger=LoggerFactory.getLogger(CRMApplication.class); 

	public static void main(String[] args) {
		SpringApplication.run(CRMApplication.class, args);
	}
	
		
	/**初始化1
	 * @param storageService
	 * @return
	 */
	@Bean
	CommandLineRunner init(AttachmentService attachmentService,ActivitiService activitiService) {
		return (args) -> {
			//初始化文件存储目录1
           // storageService.deleteAll();
			attachmentService.init();
       
		};
	}
}
